// 给函数指定类型的第一种方式
/* const person1: { name: string; age: number; sum: (n1: number, n2: number) => number } = {
  name: 'ifer',
  age: 18,
  sum(n1, n2) {
    return n1 + n2
  },
}

person1.sum(1, 2) */

// 给函数指定类型的第二种方式
/* const person1: { name: string; age: number; sum(n1: number, n2: number): number } = {
  name: 'ifer',
  age: 18,
  sum(n1, n2) {
    return n1 + n2
  },
}

person1.sum(1, 2) */

// 只要右边能满足左边的类型定义即可
// const o: { length: number } = { length: 8 }
// const o: { length: number } = 'abc'
const o: { length: number } = ['a', 'b']

function axios(o: { url: string; method?: string }) {}
